# 
# (C) Copyright 2019 - ShenYongchen.
#
#
###############################################################################
# 
find_package(Doxygen)
# sfx_print()

if(DOXYGEN_FOUND)

  # 
  # DOXYGEN_LANGUAGE
  # 
  set(DOXYGEN_LANGUAGE "English" CACHE STRING "Language used by doxygen")
  mark_as_advanced(DOXYGEN_LANGUAGE)

  # 
  # you could also set the version or other defines, see Doxygen.in
  # 
  # [1] Project related configuration options
  # 
  # PROJECT_NAME           = @SFX_DOXYGEN_PROJECT_NAME@
  # PROJECT_NUMBER         = @SFX_DOXYGEN_PROJECT_VERSION@
  #
  set(SFX_DOXYGEN_PROJECT_NAME "CSK")
  set(SFX_DOXYGEN_PROJECT_VERSION "1.0.0")

  # 
  # [4] Configuration options related to the source input files
  # 
  # INPUT                 = @SFX_DOXYGEN_INPUT_LIST@
  # IMAGE_PATH            = @SFX_DOXYGEN_IMAGE_PATH@
  # FILE_PATTERNS         = @SFX_DOXYGEN_FILE_PATTERNS@
  # 
  # SFX_DOXYGEN_INPUT_LIST
  set(_document_source_dir_
    # "${CMAKE_CURRENT_LIST_DIR}"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.Core"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.Data"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.Data.Esri"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.GeoApi"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.IO"
    # "${CMAKE_SOURCE_DIR}/projs_csk/CSharpKit.IO.Compression"
  )
  string(REPLACE ";" " " SFX_DOXYGEN_INPUT_LIST "${_document_source_dir_}")
  # message(STATUS "SFX_DOXYGEN_INPUT_LIST = " ${SFX_DOXYGEN_INPUT_LIST})

  # SFX_HTML_OUTPUT = html
  set(SFX_HTML_OUTPUT "html")

  # SFX_DOXYGEN_IMAGE_PATH
  set(SFX_DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/images")
  
  # SFX_DOXYGEN_FILE_PATTERNS
  set(SFX_DOXYGEN_FILE_PATTERNS "*.cxx *.cs")

  # 
  # configure_file
  # 
  configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

  # 
  # add_custom_target
  # 
  set(html_target "csk_help" )
  add_custom_target(${html_target} ALL
    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

  # 
  # install
  # 
  # install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION "/usr/share/doc/libnoise-${DOXYGEN_DOCUMENT_VERSION}")
  install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION "d:/temp/cskhelp/csk")
  # 
else()
  # 
  message(STATUS "doxygen binary couldn't be found - waring...")
  # 
endif()

#}}@@@

